Skip to content

doc: add an initial compute autoscaling RFC - #197

Open
savme wants to merge 2 commits into
mainfrom
doc/rfc-compute-load-autoscaling
Open

doc: add an initial compute autoscaling RFC#197
savme wants to merge 2 commits into
mainfrom
doc/rfc-compute-load-autoscaling

Conversation

@savme

@savme savme commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Proposes adding load-driven horizontal autoscaling for Compute workloads.

The autoscaler would read CPU/memory usage, compare it to the workload's configured targets, and update the desired replica target through the WorkloadDeployment scale subresource. It follows Kubernetes HPA's basic ratio formula, but uses faster scale-up and shorter scale-down smoothing because Compute instances start in milliseconds.

Scaling decisions happen per deployment/location. The autoscaler only sets the desired target; existing instance management policy still controls how instances are created or deleted.

Scale-to-zero, wake-on-traffic, and the concrete metrics source integration are left for separate work.

Related to datum-cloud/enhancements#799

@savme
savme requested review from 0xmc and scotwells July 28, 2026 15:34
@scotwells

Copy link
Copy Markdown
Contributor

@savme what's it look like to leverage the HPA controller? We would just need to run a small prometheus deployment in the cluster for instance metrics?

@savme

savme commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@scotwells assuming we'd run stock HPA at the edge, I think Prometheus would only be one piece. We'd also need to:

  • implement the WorkloadDeployment scale subresource (including a selector that maps each deployment to its backing pods)
  • make sure Karmada doesn't fight autoscaling decisions by adding custom retention for HPA-owned fields on WorkloadDeployment
  • run a metrics adapter HPA can query for kraftlet-managed Pods, likely Prometheus + prometheus-adapter via custom metrics
  • create an HPA per WorkloadDeployment scaling policy

@scotwells

Copy link
Copy Markdown
Contributor

@savme nice! That seems like a pretty clean path.

Thoughts on trying that before we reach to re-implementing the capabilities HPA gives us?

@savme

savme commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@scotwells good call! The RFC is close enough to HPA, so this is definitely worth prototyping first. I think most of the timing defaults that may not work well for us are probably tunable anyway. I'll try an HPA-based approach so we can see what the integration looks like and whether we're happy with the scaling latency/behavior. I'll update the doc based on what we find

@savme

savme commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Linking related work here: datum-cloud/unikraft-provider#54

@0xmc

0xmc commented Aug 5, 2026

Copy link
Copy Markdown

Curious if you have any HPA findings to report @savme

@savme

savme commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Hey @0xmc 👋

Definitely! The biggest thing to report is: kraftlet does not currently provide a straightforward way to ingest metrics that would be compatible with metrics.k8s.io (which is a requirement for a resource-based HPA), so we'll need a workaround to expose metrics it does provide in a compatible format.

I'd love to run the full ingest pipeline by you when you have a few minutes. My current sense is that the best path forward is a small exporter that exposes metrics from ukpd (https://unikraft.com/docs/integrations/sdks/go#instances) (mapping ukpd instances to pods) alongside a prometheus-adapter registered as a metrics-server for the cluster.

I'm basing this on Scot's work in datum-cloud/unikraft-provider#54. You can check out the implementation in the linked PRs on datum-cloud/enhancements#799.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants